package com.obtk.byproperty.service.impl;

import com.obtk.byproperty.dao.ChargetDetailMapper;
import com.obtk.byproperty.pojo.ChargeDetail;
import com.obtk.byproperty.service.ChargeDetailService;
import com.obtk.byproperty.service.ChargeItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ChargeDetailServiceImpl implements ChargeDetailService {

    @Autowired
    private ChargetDetailMapper chargetDetailMapper;

    @Override
    public ChargeDetail getChargeId(Integer chargeItemId) {
        return chargetDetailMapper.selectByPrimaryKey(chargeItemId);
    }

    @Override
    public Boolean update(ChargeDetail chargeDetail) {
        int row = chargetDetailMapper.updateByPrimaryKeySelective(chargeDetail);
        if(row>0){
            return true;
        }
        return false;
    }

    @Override
    public List<ChargeDetail> selectAnnouncements(String contractor) {
        return chargetDetailMapper.selectAnnouncements(contractor);
    }


}
